#include "log.hpp"
#include "HttpServer.hpp"
#include <string>
#include <string.h>
#include <memory>

void Usage(std::string proc)
{
    std::cout << "\n\rUsage: " << proc << " port[1024+]\n" << std::endl;
}

//用浏览器使用47.122.127.6：端口号，就可以发送报文
int main(int argc, char *argv[])
{
    if(argc < 2|| argc > 2)
    {
        Usage(argv[0]);
        return 1;
    }
    else
    {
        uint16_t port = stoi(argv[1]);//服务端指定端口值
        unique_ptr<HttpServer> tsvp(new HttpServer(port));
        tsvp->Init(); 
        tsvp->Run(); 
    }

    return 0;
}